<?php $this->headTitle("Formulaire de contact") ?>
<h4>Contact</h4>
<h3>Formulaire de contact</h3>

<?php if ($this->errors) : ?>
    <div class="well">
        <?php foreach($this->errors as $error) : ?>
            <p class="text-error"><?php echo $error ?></p>
        <?php endforeach ?>
    </div>
<?php endif ?>

<?php if ($this->infoMessage) : ?>
    <div class="well">
        <p class="text-success"><?php echo $this->infoMessage ?></p>
    </div>
<?php endif ?>


<form class="form-horizontal" method="post" action="">
    <div class="control-group">
        <label class="control-label" for="inputSubject">Sujet</label>
        <div class="controls">
            <input required type="text" name="inputSubject" id="inputSubject" placeholder="Sujet de votre mail" value="<?php echo $this->inputSubject ?>" />
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="inputEmail">Votre email</label>
        <div class="controls">
            <input required type="email" name="inputEmail" id="inputEmail" placeholder="Votre adresse email" value="<?php echo $this->inputEmail ?>"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="inputMessage">Votre message</label>
        <div class="controls">
            <textarea required rows="8" cols="50" name="inputMessage" id="inputMessage" placeholder="Votre message"><?php echo $this->inputMessage ?></textarea>
        </div>
    </div>
    <div class="control-group">
        <button type="submit" name="submit" id="submit_button" class="btn btn-primary">Envoyer</button>
        <button type="button" id="reset_button" class="btn">Annuler</button>
    </div>
    <?php echo $this->AuthenticationTokenInput() ?>
</form>

<style>
    /* Extend inputs & textarea */
    input, textarea {
        width: 450px;
    }
</style>

<script>
    $('#reset_button').click( function() {
        document.location.href = '/';
    });
</script>